
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.TaskClassGradeMajorDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class TaskClassGradeMajorDaoJdbc extends BaseDaoJdbc implements TaskClassGradeMajorDao {
	String tableName="T_TASK_CLASS_GRADE_MAJOR";
	String beanName="taskClassGradeMajor";
	
	public CommonBean createTaskClassGradeMajor(){
		CommonBean taskClassGradeMajors=this.createBean(tableName,beanName);
                return taskClassGradeMajors;		
	}
	
/*
	public CommonBean findTaskClassGradeMajors(String refid) {
		CommonBean taskClassGradeMajors=this.createTaskClassGradeMajor();
		String sql="select * from T_TASK_CLASS_GRADE_MAJOR where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		taskClassGradeMajors.addData(data);
                return taskClassGradeMajors;
       }
*/
	public CommonBean findTaskClassGradeMajorById(String id) {
		CommonBean taskClassGradeMajors=this.createTaskClassGradeMajor();
		String sql="select * from T_TASK_CLASS_GRADE_MAJOR where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		taskClassGradeMajors.addData(data);
    return taskClassGradeMajors;
  }
  
	public CommonBean findAllTaskClassGradeMajors() {
		CommonBean taskClassGradeMajors=this.createTaskClassGradeMajor();
		String sql="select * from T_TASK_CLASS_GRADE_MAJOR ";
		List data=this.getCommonDao().select(sql,new String[]{});
		taskClassGradeMajors.addData(data);
    return taskClassGradeMajors;
  }
	public void insertTaskClassGradeMajor(CommonBean taskClassGradeMajorBean){
		List data=taskClassGradeMajorBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
}

